package com.keke.service.role;

import com.keke.ado.baseDao;
import com.keke.ado.role.roleDao;
import com.keke.ado.role.roleDaoImpl;
import com.keke.pojo.Role;
import org.junit.Test;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;

public class RoleServiceImpl implements RoleService{

    //引入Dao
    private roleDao roledao ;
    public RoleServiceImpl() {
        this.roledao = new roleDaoImpl();
    }


    public List<Role> getRoleList() {
        List<Role> roleList=null;
        Connection connection=null;
        try {
            connection = baseDao.getConnection();
            roleList= roledao.getRoleList(connection);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            baseDao.close(connection,null,null);
        }
        return roleList;
    }

}
